//
//  PGSecKey.h
//  iPWManager
//
//  Created by Alexander Wahl on 11/10/11.
//  Copyright (c) 2011 __MyCompanyName__. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <PhoneGap/PGPlugin.h>
#import <Security/Security.h>
#import "NSData+Base64.h"


@interface PGSecKey : PGPlugin {
    NSString* callbackID; 
    NSData * privateTag;
    NSData * publicTag;
}

@property (nonatomic, copy) NSString* callbackID;
@property (nonatomic, retain) NSData * privateTag;
@property (nonatomic, retain) NSData * publicTag;

 

- (void) getBase64EncodePrivateKey:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options;
- (void) getBase64EncodePublicKey:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options;
- (void) deleteKeys:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options;
- (void) generateKeys:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options;

- (void) generateKeys;
- (NSData*)getPrivateKeyBits;
- (NSData *)getPublicKeyBits;
- (void)deleteAsymmetricKeys;
- (NSString *) getRSAPublicKeyAsBase64;
- (size_t) encodeLength: (unsigned char *) buf withLenght:(size_t) length;
- (void) writeToTextFile: (NSString *) content fileName: (NSString*) fileName;
- (NSString *) readFromTextFile: (NSString*) fileName;
- (Boolean) deleteFile: (NSString*) fileName;
@end

